package com.cy.mall.web.front.goods;

import com.cy.mall.model.Result;
import com.cy.mall.model.vo.goods.GoodsTypeListVO;
import com.cy.mall.service.goods.GoodsTypeService;
import com.cy.mall.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description 前台-商品品类管理
 * @Author tanyilin
 * @Date 2019/9/27 15:51
 */
@RestController
@RequestMapping("/goods/type")
@Api(tags = "前台-商品品类管理")
public class GoodsTypeController extends BaseController {

    @Autowired
    private GoodsTypeService goodsTypeService;

    @ApiOperation("全部的已上架的商品品类列表，不分页")
    @GetMapping("/get/all/enable/list")
    public Result<List<GoodsTypeListVO>> getAllEnableList() {

        List<GoodsTypeListVO> list = goodsTypeService.getAllEnableGoodsTypeList();
        return ok("获取成功", list);
    }

}
